﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace WebApplication1.App_Start
{
    public class FileResult:IResult
    {
        private string fileName = null;
        public FileResult(string fileName)
        {
            this.fileName = fileName;
        }
        public void Execute(HttpContext context, string controllerName, string actionName)
        {
            context.Response.ContentType = "application/octet-stream;";
            context.Response.WriteFile(fileName);
        }
    }
}